#include "builder.h"

GameCoumputerBuiler::GameCoumputerBuiler()
{
    m_computer = std::make_shared<Computer>();
}

void GameCoumputerBuiler::buildCPU()
{
    if(!m_computer)
        throw "computer is nullptr";
    m_computer->setCPU("i7-14400-8核-16线程");
}

void GameCoumputerBuiler::buildRAM()
{
    if(!m_computer)
        throw "computer is nullptr";
        m_computer->setRAM("64G-DDR4");
}

void GameCoumputerBuiler::buildStorage()
{
    if(!m_computer)
        throw "computer is nullptr";
    m_computer->setStorage("2T-SSD");
}

WorkCoumputerBuiler::WorkCoumputerBuiler()
{
    m_computer = std::make_shared<Computer>();
}

void WorkCoumputerBuiler::buildCPU()
{
    if(!m_computer)
        throw "computer is nullptr";
    m_computer->setCPU("i5-14400-6核-12线程");
}

void WorkCoumputerBuiler::buildRAM()
{
    if(!m_computer)
        throw "computer is nullptr";
    m_computer->setRAM("32G-DDR4");
}

void WorkCoumputerBuiler::buildStorage()
{
    if(!m_computer)
        throw "computer is nullptr";
    m_computer->setStorage("1T-SSD");
}
